package com.killer.controller;

import com.killer.pojo.AuthCode;
import com.killer.service.code.CodeService;
import com.killer.util.DateUtil;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：Killer
 * @date ：Created in 20-12-31 下午3:16
 * @description：${description}
 * @modified By：
 * @version: version
 */
@RestController
@RequestMapping("/code")
public class CodeController {

    @Autowired
    private CodeService codeService;

    @RequestMapping("/create/{email}")
    public Boolean generateCode(@PathVariable String email){
        try {
            codeService.generateCode(email);
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }


}
